﻿// Decompiled with JetBrains decompiler
// Type: DnProcessSimulateCommands.SimulationSettings.CUiSimulationSettingsCmd
// Assembly: DnProcessSimulateCommands, Version=2402.0.0.890, Culture=neutral, PublicKeyToken=null
// MVID: A885D881-AEDF-447E-852A-6F13102E089C
// Assembly location: C:\Program Files\Tecnomatix_2402\eMPower\DotNetCommands\DnProcessSimulateCommands.dll

using System;
using System.Windows;
using Tecnomatix.Engineering;


namespace DnProcessSimulateCommands.SimulationSettings;

public class CUiSimulationSettingsCmd : TxButtonCommand
{
  private CUiSimulationSettingsCmdEnabler enabler_ = new CUiSimulationSettingsCmdEnabler();
  private static bool m_isOpened;

  public virtual string Name => StringTable.REAL_TIME_SIMULATION_NAME;

  public virtual string Bitmap => "RealTimeSimulation.RealTimeSimIcon.bmp";

  public virtual string Category => StringTable.REAL_TIME_SIMULATION_CATEGORY;

  public virtual void Execute(object cmdParams)
  {
    if (CUiSimulationSettingsCmd.m_isOpened)
      return;
    CUiSimulationSettingsWindow simulationSettingsWindow = new CUiSimulationSettingsWindow();
    ((Window) simulationSettingsWindow).Closed += new EventHandler(this.ss_Closed);
    CUiSimulationSettingsCmd.m_isOpened = true;
    simulationSettingsWindow.ShowDialog(true);
  }

  private void ss_Closed(object sender, EventArgs e) => CUiSimulationSettingsCmd.m_isOpened = false;

  public virtual ITxCommandEnabler CommandEnabler => (ITxCommandEnabler) this.enabler_;
}
